package cn.dengta.webapp.user.vo;

import java.util.Date;
import java.util.Map;

import cn.dengta.webapp.base.vo.AbstractVO;
import cn.dengta.webapp.user.entity.MomentOperateLog;
import cn.dengta.webapp.user.entity.MomentOperateLog.MomentOperate;
import lombok.Getter;
import lombok.Setter;
import me.codeplayer.util.X;

@Getter
@Setter
public class MomentOperateLogVO extends AbstractVO<MomentOperateLog> {

	/** 用户id */
	public Long userId;
	/** 操作类型 */
	public transient MomentOperate type;
	/** 动态ID */
	public Long momentId;
	/** 动态的评论ID */
	public Long commentId;
	/** 备注信息 */
	public String remark;
	/** 业务处理 0=未处理；1=已处理 */
	private Integer handleStatus;
	/** 是否已删除 */
	private Boolean hasDel;
	/** 是否是回复 */
	private Boolean hasReply;

	public Map<String, Object> user;
	public Object assoc;

	public static MomentOperateLogVO from(MomentOperateLog source) {
		return copy(source, MomentOperateLogVO::new);
	}

	public String getOperate() {
		return X.map(type, MomentOperate::getLabel);
	}

	public Integer getOperateValue() {
		return X.map(type, MomentOperate::getValue);
	}

	@Override
	public Date getAddTime() {
		return super.getAddTime();
	}

}
